package de.bazinga.rotw.network;

import java.util.Vector;


/**
 * Holds all the IPs of the currently in the LAN active Servers
 * 
 * @author Dennis Franke
 *
 */
public class LANGames {

	private static LANGames games = null;
	
	private Vector<String> lanGames = new Vector<String>();
	
	private LANGames() {
		
	}
	
	public static LANGames getInstance() {
		if(games == null) games = new LANGames();
		return games;
	}
	
	
	/**
	 * Remove all the Game-Server
	 */
	public void clearGames() {
		lanGames.clear();
	}
	
	
	/**
	 * Add a new Game-Server
	 * @param game the IP-Address of the Server
	 */
	public synchronized void addGame(String game) {
		lanGames.add(game);
	}
	
	
	@SuppressWarnings("unchecked")
	public synchronized Vector<String> getGames() {
		return (Vector<String>)lanGames.clone();
	}
}
